﻿/*  
 *  IIS LogFile Analyser, Copyright (C) 2013. http://www.iis-analyser.com
 *  --
 *  This program is free software, provided "AS IS" WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
 * 
 *  File Author: Ian Quigley,    2013-02-23
 */


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace Web
{
    public partial class Main : System.Web.UI.MasterPage
    {
        protected void Page_Load( object sender, EventArgs e )
        {
            if (Visitor.Current.IsAnonymous)
                Response.Redirect( "login.aspx", true );

            var store = BasePage.GetDataStore();

            StringBuilder html = new StringBuilder();
            foreach (var view in store.Views( true ))
                html.AppendFormat( "<li><a href=\"view.aspx?id={0}\">{1}</a></li>", view.Id, view.Name );

            litMenu.Text = html.ToString();




        }
    }
}